package com.chagee.store.operation.api.enums;

import com.google.common.collect.Sets;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;
import java.util.Set;

/**
 * @ClassName StoreStatusEnum
 * @Description: 门店状态枚举对象
 * @Author: Jacky-zhan	//作者
 * @CreateDate: 2024/2/28 11:01	//创建时间
 * @UpdateUser: Jacky-zhan
 * @UpdateDate: 2024/2/28 11:01	//更新时间
 * @UpdateRemark: 更新的信息
 * @Version: 1.0    //版本号
 */
@Getter
@AllArgsConstructor
public enum StoreWorkOrderStatusEnum {

	//	ALL(100, "全部"),
	IN_APPEAL(7, "申诉中"),
	TO_BE_HANDED_OVER(6, "待交接"),
	PENDING_ORDERS(0, "待接单"),
	TO_BE_EXECUTED(1, "待执行"),
	IN_PROGRESS(2, "执行中"),
	TO_BE_ACCEPTED(3, "待验收"),
	COMPLETED(4, "已完成"),
	EXPIRED(5, "已过期"),
	EXPIRED_APPEAL(8, "申诉中")

	;
	private final Integer type;
	private final String desc;

	public static StoreWorkOrderStatusEnum getByType(Integer type) {
		for (StoreWorkOrderStatusEnum value : values()) {
			if (Objects.equals(value.getType(), type)) {
				return value;
			}
		}
		return null;
	}

	public static final Set<Integer> ORDER_APPEAL_TYPE = Sets.newHashSet(StoreWorkOrderStatusEnum.EXPIRED.getType(), StoreWorkOrderStatusEnum.COMPLETED.getType());
}
